## DFT2LNT Library project
project (dftmisc)

## Needed for bison and flex
cmake_minimum_required (VERSION 3.0)

set(CMAKE_INSTALL_PREFIX ${DFTROOT} CACHE INTERNAL "" FORCE)

## Installation
FILE(GLOB dftfiles "${CMAKE_CURRENT_SOURCE_DIR}/tests/*.dft")
FILE(GLOB testfiles "${CMAKE_CURRENT_SOURCE_DIR}/tests/*.test")

if(DEFINED ENV{CADP})
	install (DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/lntnodes"
		DESTINATION share/dft2lnt
		FILE_PERMISSIONS OWNER_READ
				 GROUP_READ
				 WORLD_READ
		
		DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
				      GROUP_READ GROUP_WRITE GROUP_EXECUTE
				      WORLD_READ WORLD_WRITE WORLD_EXECUTE
	)
	install (DIRECTORY
		DESTINATION share/dft2lnt/bcgnodes/
		DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE
				      GROUP_READ GROUP_WRITE GROUP_EXECUTE
				      WORLD_READ WORLD_WRITE WORLD_EXECUTE
	)
endif()

install (FILES ${dftfiles}
	DESTINATION share/dft2lnt/tests
	PERMISSIONS OWNER_READ
	            GROUP_READ
	            WORLD_READ
)
install (FILES ${testfiles}
	DESTINATION share/dft2lnt/tests
	PERMISSIONS OWNER_READ
	            GROUP_READ
	            WORLD_READ
)
